package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the HOSP_USER database table.
 * 
 */
@Entity
@Table(name="HOSP_USER")
@NamedQuery(name="HospUser.findAll", query="SELECT h FROM HospUser h")
public class HospUser implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1, allocationSize=1, name="USER_ID_GENERATOR", sequenceName="SEQ2")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="USER_ID_GENERATOR")
	private long userid;

	@Temporal(TemporalType.DATE)
	@Column(name="REGISTER_DATE")
	private Date registerDate;

	private String uaccount;

	private String upassword;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="STAFF_ID")
	private Staff staff;

	//bi-directional many-to-many association to Role
	@ManyToMany
	@JoinTable(
			name="RELATIONSHIP_154"
			, joinColumns={
				@JoinColumn(name="ROLE_ID")
				}
			, inverseJoinColumns={
				@JoinColumn(name="USERID")
				}
			)
	private List<Role> roles;

	public HospUser() {
	}
	
	public HospUser(long userid, Date registerDate, String uaccount, String upassword) {
		super();
		this.userid = userid;
		this.registerDate = registerDate;
		this.uaccount = uaccount;
		this.upassword = upassword;
	}

	public long getUserid() {
		return this.userid;
	}

	public void setUserid(long userid) {
		this.userid = userid;
	}

	public Date getRegisterDate() {
		return this.registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	public String getUaccount() {
		return this.uaccount;
	}

	public void setUaccount(String uaccount) {
		this.uaccount = uaccount;
	}

	public String getUpassword() {
		return this.upassword;
	}

	public void setUpassword(String upassword) {
		this.upassword = upassword;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}